package com.wang.learn.cloudrabbitmq.component;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 取消订单消息的消费者
 *
 * @author macro
 * @date 2018/9/14
 */
@Component
@Slf4j
public class CancelOrderReceiver {

    @RabbitListener(queues = "mall.order.cancel")
    public void handle(Long orderId){
        log.info("取消订单处理，process orderId:{}",orderId);
    }

    @RabbitListener(queues = "queue1")
    public void test1(Long orderId){
        log.info("短信:{}",orderId);
    }

    @RabbitListener(queues = "queue2")
    public void test2(Long orderId){
        log.info("邮件:{}",orderId);
    }



}
